<?php

if(!empty($_GET['nickname_flag']))
{
//	echo 666;
//	die;
	$re = selectone('admin',"nickname='".$_GET['nickname']."'");

	if(empty($re))
	{
		echo 12000;
	}else
	{
		echo 12001;
	}
	die;
}

if(!empty($_POST))
{
	unset($_POST['psd_confirm']);
	$id = $_POST['Id'];
	$_POST['password'] = md5($_POST['password']);
	$result = update('admin', $_POST, $id);
	if($result)
	{
		echo '修改成功';
		header('Refresh:1;index.php?a=admin&b=maneger&c=index');
		die;
	}
	else
	{
		echo '修改失败';
		header('Refresh:1;index.php?a=admin&b=maneger&c=index');
		die;
	}	
}

$id = $_GET['id'];
$re = selectone('admin','Id='.$id);
include('app/admin/maneger/html/update.html');
?>